<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<section class="content-header" style="">
    <h1>
        休眠原因
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li class="active">休眠原因</li>
    </ol>
</section>

<section class="content">
    <ul class="nav nav-tabs">
        <shiro:lacksRole name="admin">
            <li><a href="#" onclick="loadHref('#dormant')">休眠户</a></li>
        </shiro:lacksRole>

        <li class="active"><a href="#">休眠原因</a></li>
    </ul>
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <!-- /.box-header -->
                <div class="box-body">
                    <p id="toolbar">
                    <table id="table"></table>
                </div>

                <!-- /.box-body -->
            </div>
            <!-- /.box -->
        </div>

    </div>
    <!-- /.row -->
</section>


<script>
    var $table = $('#table');
    var comid='${id}';
    //$(function () {
        $table.bootstrapTable({
            url: path + '/dormant/history?id='+comid,
            idField: 'id',
            searchOnEnterKey: true,
            showColumns: false,
            detailView: false,
            search: false,
            striped: true,
            //queryParams: Search,
            //pagination: true,

            //得到查询的参数
            queryParams : function (params) {
                //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                var temp = {
                    limit: params.limit,                         //页面大小
                    offset: params.offset,   //页码
                    // sort: params.sort,      //排序列名
                    order: params.order //排位命令（desc，asc）
                };
                return temp;
            },
            columns: [
                {field: 'operateTime', title: '操作时间'},
                {
                    field: 'status', title: '所处阶段', formatter: function (value, row, index) {
                        if (value == 1) {
                            return "待尽调"
                        } else if (value == 2) {
                            return "待部门审核"
                        } else if (value == 3) {
                            return "待风控审核"
                        } else if (value == 4) {
                            return "待上线"
                        } else if (value == 5) {
                            return "贷后管理"
                        } else if (value == 6) {
                            return "存档"
                        }
                    }
                },
                {field: 'demo', title: '原因'}
            ]
        });
    //});
</script>